<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
	.KEYW {color: #933;}
	.COMM {color: #bbb; font-style: italic;}
	.NUMB {color: #393;}
	.STRN {color: #393;}
	.REGX {color: #339;}
	.linenumber {border-right: 1px dotted #666; color: #666; font-style: normal;}
	</style></head><body><pre><span class='linenumber'>  1</span> <span class="COMM">/*divHook - create a snapIn from markup
<span class='linenumber'>  2</span> 
<span class='linenumber'>  3</span>  A snapIn that would convert a div with a certain id into a snapin.
<span class='linenumber'>  4</span>  Here we use the functionality to host joomla modules.
<span class='linenumber'>  5</span> 
<span class='linenumber'>  6</span> */</span><span class="WHIT">
<span class='linenumber'>  7</span> 
<span class='linenumber'>  8</span> </span><span class="COMM">/*
<span class='linenumber'>  9</span>   Create your own !UNIQUE! Namespace by using the JAVA convention of
<span class='linenumber'> 10</span>   reversing your domain name or get a key from 2112Portals, or generate a GUID
<span class='linenumber'> 11</span>   The Problem with domains are:
<span class='linenumber'> 12</span>   1. You could not use domains starting with numbers (like ours 2112Portals.com)
<span class='linenumber'> 13</span>      Since JS does not eval variable starting with numbers.
<span class='linenumber'> 14</span>      So you could circumvent it by adding an underscore.
<span class='linenumber'> 15</span>   2. Well - for every dot-separated string an object would be created.
<span class='linenumber'> 16</span>      So on large Portals with many snapIns this may cause some performance
<span class='linenumber'> 17</span>      issues on the clients.
<span class='linenumber'> 18</span>   3. My recommendation: 
<span class='linenumber'> 19</span>      Use a single unique ID i.e. turn the dots in your Domain Name 
<span class='linenumber'> 20</span>      into myDomain_de/myDomain_net.
<span class='linenumber'> 21</span> */</span><span class="WHIT">
<span class='linenumber'> 22</span> 
<span class='linenumber'> 23</span> 
<span class='linenumber'> 24</span> 
<span class='linenumber'> 25</span> </span><span class="NAME">NS2112.namespace</span><span class="PUNC">(</span><span class="STRN">"INTRINSICS"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 26</span> 
<span class='linenumber'> 27</span> </span><span class="NAME">NS2112.INTRINSICS.snapDivHook</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">el</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">userConfig</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'> 28</span> </span><span class="PUNC">{</span><span class="WHIT">  </span><span class="WHIT">
<span class='linenumber'> 29</span> </span><span class="WHIT">   </span><span class="NAME">this.constructor.superclass.constructor.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">el</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">userConfig</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 30</span> </span><span class="WHIT">   </span><span class="NAME">this.Title</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'divHook'</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 31</span> </span><span class="WHIT">   </span><span class="NAME">this.Name</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'divHook'</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 32</span> </span><span class="WHIT">   </span><span class="NAME">this.Width</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 33</span> </span><span class="WHIT">   </span><span class="NAME">this.Height</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 34</span> </span><span class="WHIT">   </span><span class="NAME">this.CanClose</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 35</span> </span><span class="WHIT">   </span><span class="NAME">this.AdjustHeight</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//let SIM manage the height.</span><span class="WHIT">
<span class='linenumber'> 36</span> </span><span class="WHIT">   </span><span class="NAME">this.Intrinsic</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 37</span> </span><span class="WHIT">   </span><span class="NAME">this.IntrinsicType</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'divHook'</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 38</span> </span><span class="WHIT">   </span><span class="NAME">this.IntrinsicObject</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 39</span> 
<span class='linenumber'> 40</span> 
<span class='linenumber'> 41</span> </span><span class="WHIT">   </span><span class="COMM">//The load callback - load your stuff here</span><span class="WHIT">
<span class='linenumber'> 42</span> </span><span class="WHIT">   </span><span class="NAME">this.load</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">myDiv</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'> 43</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'> 44</span> </span><span class="WHIT">     </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">myModuleBox</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 45</span> </span><span class="WHIT">     </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">myDiv.tagName</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="COMM">//it's a div</span><span class="WHIT">
<span class='linenumber'> 46</span> </span><span class="WHIT">     </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'> 47</span> </span><span class="WHIT">       </span><span class="NAME">myModuleBox</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">myDiv</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 48</span> </span><span class="WHIT">     </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'> 49</span> </span><span class="WHIT">     </span><span class="KEYW">else</span><span class="WHIT">
<span class='linenumber'> 50</span> </span><span class="WHIT">     </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'> 51</span> </span><span class="WHIT">         </span><span class="NAME">myModuleBox</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.getElementById</span><span class="PUNC">(</span><span class="NAME">myDiv</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 52</span> </span><span class="WHIT">         </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">myModuleBox</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 53</span> </span><span class="WHIT">         </span><span class="NAME">myModuleBox.style.display</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'block'</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 54</span> </span><span class="WHIT">     </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'> 55</span> 
<span class='linenumber'> 56</span> </span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'> 57</span> </span><span class="WHIT">      </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">myModuleBox</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 58</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'> 59</span> 
<span class='linenumber'> 60</span> </span><span class="WHIT">   </span><span class="NAME">this.unload</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'> 61</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'> 62</span> </span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'> 63</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'> 64</span> </span><span class="WHIT">   </span><span class="COMM">//remember? - u need a unique name. </span><span class="WHIT">
<span class='linenumber'> 65</span> </span><span class="WHIT">   </span><span class="WHIT">
<span class='linenumber'> 66</span> </span><span class="WHIT">     </span><span class="WHIT">
<span class='linenumber'> 67</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'> 68</span> 
<span class='linenumber'> 69</span> </span><span class="NAME">NS2112.extend</span><span class="PUNC">(</span><span class="NAME">NS2112.INTRINSICS.snapDivHook</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">NS2112.snapIn12</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 70</span> </span><span class="NAME">NS2112.registerSnapIn</span><span class="PUNC">(</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">NS2112.INTRINSICS.snapDivHook</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"com._2112_.intrinsics"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">   </span><span class="WHIT">
<span class='linenumber'> 71</span> 
<span class='linenumber'> 72</span> 
<span class='linenumber'> 73</span> 
<span class='linenumber'> 74</span> 
<span class='linenumber'> 75</span> 
<span class='linenumber'> 76</span> 
<span class='linenumber'> 77</span> 
<span class='linenumber'> 78</span> 
<span class='linenumber'> 79</span> 
<span class='linenumber'> 80</span> 
<span class='linenumber'> 81</span> 
<span class='linenumber'> 82</span> 
<span class='linenumber'> 83</span> </span></pre></body></html>